package utils;

import java.sql.Connection;
import java.sql.DriverManager;

public class DbUtils {
	private final static String DRIVER="net.sourceforge.jtds.jdbc.Driver";
	private final static String URL = "jdbc:jtds:sqlserver://localhost:1433/book_recycling";
	private final static String USERID = "sa";
	private final static String UERPASSWORD = "123456";
	
	private DbUtils(){}
	
	static {
		try {
			Class.forName(DRIVER);
		}catch(Exception e){
			e.printStackTrace();
		}
	}
	
	public static Connection getConnection() {
		Connection conn=null;
		try {
			conn=DriverManager.getConnection(URL, USERID, UERPASSWORD);
		}catch(Exception e) {
			e.printStackTrace();
		}
		return conn;
	}
}
